package com.dferreira.languagesteach.helpers;

import com.dferreira.languagesteach.activities.NavigationActivity;
import com.dferreira.repository.Repository;

public class RestoreLastSessionDelegator {

    private final NavigationActivity nvgLst;

    public RestoreLastSessionDelegator(NavigationActivity nvgLst) {
        this.nvgLst = nvgLst;
    }

    /**
     * When creates or re-create the activity will make a set of validations
     * before show the resume option to user
     *
     * @param packagesRepository reference to repository where will verify if the required
     *                           package is installed
     */
    public void onCreate(Repository packagesRepository) {
        /*
        RestoreLastScreen restoreLastScreen;
        GlobalState lastGlobalState;
        String nvgLstControllerClassName;
        String lastScreenClassName;

        restoreLastScreen = new RestoreLastScreen(nvgLst);
        if (restoreLastScreen.existAnySubjectPathSaved()) {
            lastGlobalState = restoreLastScreen.getLastSubjectPath();
            if (packagesRepository.isPackageInstalled(lastGlobalState
                    .getLanguagePrefix())) {
                lastScreenClassName = lastGlobalState.getCurrentClassController();
                nvgLstControllerClassName = nvgLst.getClass().getName();
                if (!lastScreenClassName.equals(nvgLstControllerClassName)) {
                    nvgLst.restorePath(lastGlobalState);
                }
            }
        }
        */
    }
}
